package com.lrm.blog.dao;

import com.lrm.blog.po.Blog;
import com.lrm.blog.po.Type;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;


import java.util.List;

/**
 * @PROJECT_NAME: blog
 * @DESCRIPTION:
 * @USER: "Wang Hong"
 * @DATE: 2022/8/15 20:23
 */
public interface TypeRepository extends JpaRepository<Type,Long> {

    Type findByName(String name);



    @Query("select t from Type t")
    List<Type> findTop(Pageable pageable);

//    @Query("select b from Type.blogs b where b.published = true ")
//    List<Blog> findPublishedBlog();

}
